<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>
		<?php
			if(is_home()){
				bloginfo('name'); echo "-"; bloginfo('description');
			} else if (is_category()){
				single_cat_title(); echo "-"; bloginfo('name');
			} else if(is_single() || is_page() ){
				single_post_title();
			}else if(is_search()){
				echo "搜索结果"; echo "-"; bloginfo('name');
			}else if(is_404()) {
				echo "未找到页面";
			}else {
				wp_title('', true);
			}
		?>
	</title>

	<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css" type="text/css" media="screen" />
	
	<script src="<?php bloginfo('template_url'); ?>/js/jquery-3.3.1.min.js"></script>
	<script src="<?php bloginfo('template_url'); ?>/js/base.js"></script>

<?php if(is_home()) { ?>
	<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/index.css">	
	<script src="<?php bloginfo('template_url'); ?>/js/index.js"></script>
<?php } else { ?>
	<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/page.css">
	<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/app.min.js"></script>
   	<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/validation.js"></script>
  	<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/underscore-min.js"></script>
	<script src="<?php bloginfo('template_url'); ?>/js/page.js"></script>
<?php } ?>	
</head>
<body>
<div id="fullpage">
	<header id="header" class="transiti">
		<div class="header-wrap">
			<div class="logo transiti">
				<a href="<?php echo home_url();?>" class="link-wrap">
					<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.55 135"><defs><style>.cls-1{fill:#d9d9d9;}.cls-2{fill:#dfdfdf;}.cls-3{fill:#e6e6e6;}.cls-4{fill:#f0f0f0;}</style></defs><title>资源 1</title><g id="图层_2" data-name="图层 2"><g id="图层_1-2" data-name="图层 1"><rect class="cls-1" x="225.54" y="45" width="10.78" height="45"/><polygon class="cls-1" points="167.35 45 167.35 90 178.14 90 178.14 55.78 205.05 55.78 205.05 90 215.84 90 215.84 50.4 210.47 45 167.35 45"/><polygon class="cls-1" points="507.19 45 464.07 45 464.07 90 474.86 90 474.86 55.78 501.77 55.78 501.77 90 512.55 90 512.55 50.4 507.19 45"/><rect class="cls-1" x="303.4" y="45" width="10.78" height="45"/><rect class="cls-1" x="384.38" y="45" width="10.78" height="45"/><polygon class="cls-1" points="282.81 45 282.9 79.36 256.81 79.36 256.81 71.64 246.03 71.64 246.03 85.38 250.71 90 289.01 90 293.7 85.37 293.6 45 282.81 45"/><path class="cls-1" d="M410.11,45l-5.24,5.37V84.85L410.2,90H449l5.34-5.15V50.28L448.9,45Zm33.48,34.36H415.65V55.88h27.94Z"/><path class="cls-1" d="M362.84,45H328.38V55.78h35.51v5.88H329.08L323.89,67V84.83L329.18,90h40.21l5.29-5.17V49.62L370,45Zm1.05,30.83v3.53H334.67V72.29h29.22Z"/><path class="cls-2" d="M100.83,126.21a67.73,67.73,0,0,0,26.59-27.62h0c-7,6.07-15.19,9.64-24.93,11.89C74,117.07,43.78,97.61,39,72.38h0c-.13-.78-.23-1.57-.3-2.36A28.61,28.61,0,0,1,41,56h0c-10,21.74-5.54,57.43,30.54,70.25,9.38,3.48,21.92,3.18,29.29-.05Z"/><path class="cls-3" d="M34.09,8.79A67.76,67.76,0,0,0,7.51,36.41h0C14.09,31,24.2,26.82,34,24.57c27.46-6.34,55.32,14.1,61.19,34.88.28,1,.53,2.1.75,3.17h0c.13.78.24,1.57.31,2.36A30.78,30.78,0,0,1,94,79h0c13.45-22.55.95-58.9-30.54-70.61-13-3.94-23-1.94-29.36.41Z"/><path class="cls-1" d="M32.52,22.83a51.4,51.4,0,0,0-25,13.58h0a67.55,67.55,0,0,0,93.32,89.8h0A52.83,52.83,0,0,1,72.54,124C41.91,112.33,31.38,79.66,41,56h0a29,29,0,0,1,4.38-7.07A28.75,28.75,0,0,1,95.14,59.45C88.05,33,60,16.5,32.52,22.83Z"/><path class="cls-4" d="M102.49,112.12a52.8,52.8,0,0,0,24.93-13.53h0A67.56,67.56,0,0,0,34.1,8.79h0A53.16,53.16,0,0,1,62.47,11C93.1,22.67,103.63,55.34,94,79h0a29,29,0,0,1-4.38,7.07A28.89,28.89,0,0,1,39.78,75.6C46.74,102,75.05,118.46,102.49,112.12Z"/></g></g></svg>
	            </a>
			</div>
			
			<div class="min-logo">
				<a href="<?php echo home_url(); ?>" class="link-wrap">
					<svg id="隔离模式" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 135 135"><defs><style>.cls-2-1{fill:#e6e6e6;}.cls-2-2{fill:#f5f5f5;}.cls-2-3{fill:#dedede;}.cls-2-4{fill:#fcfcfc;}</style></defs><title>LOGO</title><path class="cls-2-1" d="M100.83,126.21a67.73,67.73,0,0,0,26.59-27.62h0c-7,6.07-15.19,9.64-24.93,11.89C74,117.07,43.78,97.61,39,72.38h0c-.13-.78-.23-1.57-.3-2.36A28.61,28.61,0,0,1,41,56h0c-10,21.74-5.54,57.43,30.54,70.25,9.38,3.48,21.92,3.18,29.29-.05Z"/><path class="cls-2-2" d="M34.09,8.79A67.76,67.76,0,0,0,7.51,36.41h0C14.09,31,24.2,26.82,34,24.57c27.46-6.34,55.32,14.1,61.19,34.88.28,1,.53,2.1.75,3.17h0c.13.78.24,1.57.31,2.36A30.78,30.78,0,0,1,94,79h0c13.45-22.55.95-58.9-30.54-70.61-13-3.94-23-1.94-29.36.41Z"/><path class="cls-2-3" d="M32.52,22.83a51.4,51.4,0,0,0-25,13.58h0a67.55,67.55,0,0,0,93.32,89.8h0A52.83,52.83,0,0,1,72.54,124C41.91,112.33,31.38,79.66,41,56h0a29,29,0,0,1,4.38-7.07A28.75,28.75,0,0,1,95.14,59.45C88.05,33,60,16.5,32.52,22.83Z"/><path class="cls-2-4" d="M102.49,112.12a52.8,52.8,0,0,0,24.93-13.53h0A67.56,67.56,0,0,0,34.1,8.79h0A53.16,53.16,0,0,1,62.47,11C93.1,22.67,103.63,55.34,94,79h0a29,29,0,0,1-4.38,7.07A28.89,28.89,0,0,1,39.78,75.6C46.74,102,75.05,118.46,102.49,112.12Z"/></svg>
				</a>
			</div>

			<div class="menu transiti">
				<ul class="clearfix menu-wrap">
					<!-- <?php foreach( $categories as $key => $category ) {?>
						<li class="menu-item link-hover" data-index="<?php echo $key;?>">
							<a href="#" class="link"><?php echo $category->name; ?> </a>
						</li>
					<?php } ?> -->

					<?php 				
						$args=array(
						'orderby' => 'id',
						'order' => 'ASC'
						);
						$i = 0;
						$categories=get_categories($args);

						$sub = array();
						foreach ($categories as $key => $category) {
							$sub[$key] = 0;
							foreach ($categories as $item) {
								if($category->term_id == $item->category_parent){
									$sub[$key] = 1;
								}
							}
						}
						// var_dump($categories);exit;
						foreach($categories as $key=>$category) {
							if($category->category_parent == 0) {
								if($category->name != '技术') {
		    		?>
						<li class="menu-item link-hover" data-index="<?php echo $i; ?>" data-sub="<?php echo $sub[$key];?>">
							<a class="link" href="<?php echo home_url('index.php/'.$category->slug.'?cat='.$category->cat_ID);?>"><?php echo $category->name; ?></a>
						</li>
					<?php } else { ?> 
						<li class="menu-item link-hover" data-index="<?php echo $i; ?>" data-sub="<?php echo $sub[$key];?>">
							<a class="link" href="<?php echo home_url('index.php/'.$category->slug);?>"><?php echo $category->name; ?></a>
						</li>
					<?php  }} $i++;} ?>
				</ul>

				<div class="min-menu-ico transiti">
					<i class="line transiti top"></i>
					<i class="line transiti middle"></i>
					<i class="line transiti bottom"></i>
				</div>
			</div>
		</div>

		<i class="line"></i>

		<div class="down-menu-wrap">
			<?php 		
				// var_dump($categories);
				
				foreach($categories as $key=>$category) {
    		?>
			<div class="down-menu">
				<ul class="down-menu-wrap">
					<?php foreach($categories as $item) {
					if($category->term_id == $item->category_parent) {
						?>
			 		<li class="down-menu-item">
			 			<a href="<?php echo home_url('index.php/'.$category->slug.'?cat='.$item->term_id);?>" class="link-wrap">
			 				<span class="text"><?php echo $item->cat_name; ?></span>
			 			</a>
			 		</li>
			 		<?php }}?>
				</ul>
			</div>
			<?php  }  ?>
	 		
		</div>

		<div class="min-menu-down">
			<div class="content">
				<ul class="clearfix">
					<?php
					 	foreach($categories as $key=>$category) {
					 		if($category->category_parent == 0) {
					 			if($category->name === '技术') {
					?>
					<li class="min-menu-item">
						<a href="<?php echo home_url('index.php/'.$category->slug); ?>" class='link-wrap'>
							<?php echo $category->cat_name; ?>
						</a>
					</li>

					<?php } else { ?>
						<li class="min-menu-item">
							<a href="<?php echo home_url('index.php/'.$category->slug).'?cat='.$category->cat_ID; ?>" class='link-wrap'>
								<?php echo $category->cat_name; ?>
							</a>
						</li>
					<?php }}}?>
				</ul>

				<i class='down-ico animate3'>
					<svg version="1.1" id="图层_2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 20.8 11.4" xml:space="preserve">
						<style type="text/css">
							.st1{fill:#999;}
						</style>
						<path class="st1" d="M10.4,11.4c-0.3,0-0.5-0.1-0.7-0.3L0.3,1.7c-0.4-0.4-0.4-1,0-1.4s1-0.4,1.4,0l9.4,9.4c0.4,0.4,0.4,1,0,1.4
							C10.9,11.3,10.7,11.4,10.4,11.4z"/>
						<path class="st1" d="M10.4,11.4c-0.3,0-0.5-0.1-0.7-0.3c-0.4-0.4-0.4-1,0-1.4l9.4-9.4c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-9.4,9.4
						C10.9,11.3,10.7,11.4,10.4,11.4z"/>
					</svg>
				</i>
			</div>
		</div>
	</header>